home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_bud.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  111 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Bud.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message        activated
  14. message        callback
  15.  
  16. cog            talkCog                    local
  17.  
  18. keyframe    get=in_reach_bulb.key    local
  19.  
  20. model        budHand=hand_in_bud.3do    local
  21.  
  22. sound        foundSnd=SS07J03.wav    local
  23.  
  24. thing        player                    local
  25. thing        item=-1                    local
  26.  
  27. int            bin=106                    local
  28. int            swapRef                    local
  29.  
  30. end
  31.  
  32. # ===================================================================
  33.  
  34. code
  35.  
  36. activated:
  37.  
  38.     player = GetSourceRef();
  39.     item = GetSenderRef();
  40.  
  41.     # Check to see if player is holding something. 
  42.     if (GetCurItem(player) != 0)
  43.     {
  44.         return;
  45.     }
  46.  
  47.     # Disable player controls and stuff
  48.     if (MakeMeStop() == -1)
  49.         return;
  50.     DeselectWeaponWait(player);
  51.  
  52.     StartCutscene(0);
  53.  
  54.     talkCog = GetCogByIndex(0);
  55.     SendMessage(talkCog, 27);
  56.  
  57.     # Wait a bit before starting animation
  58.     if (GetInv(player, bin) < GetInvMax(player, bin))
  59.     {
  60.         Sleep(0.33);
  61.         CaptureThing(player);
  62.         PlayKey(player, get, 5, 0x12, 0); 
  63.     }
  64.     else
  65.     {
  66.         ClearActorFlags(player, 0x200000);
  67.         EndCutscene();
  68.         return;
  69.     }
  70.  
  71.     SetExtCamOffset('0.15 -0.05 0.04');
  72.     SetExtCamLookOffset('0.0 0.02 0.0');
  73.  
  74.     return;
  75.  
  76. # -------------------------------------------------------------------
  77.  
  78. callback:
  79.  
  80.     if (GetParam(1) == 21)
  81.     {
  82.         swapRef = SetThingMesh(player, 15, budHand, 0);
  83.  
  84.         if (item != -1)
  85.         {
  86.             DestroyThing(item);
  87.             item = -1;
  88.         }
  89.     }
  90.     else
  91.     {
  92.         ReleaseThing(player);
  93.         RestoreThingMesh(player, swapRef);
  94.     
  95.         ChangeInv(player, bin, 1.0);
  96.         SetInvAvailable(player, bin, 1);
  97.         JonesInvItemChanged(bin);
  98.     
  99.         RestoreExtCam();
  100.     
  101.         Sleep(1.0);
  102.         PlayVoice(player, foundSnd, 1.0, 0);
  103.     
  104.         ClearActorFlags(player, 0x200000);
  105.         EndCutscene();
  106.     }
  107.  
  108.     return;
  109.  
  110. end
  111.